home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Virtual User 1.0 / Virtual User / MPW Scripts / PickTarget_vu < prev    next >
Text File  |  1991-01-25  |  2KB  |  67 lines

  1. #
  2. #    File:        PickTarget_vu
  3. #
  4. #    Contains:    This script lets the user pick a target machine through a simple dialog.
  5. #                It searches the current zone for all machines currently running 'Agent VU',
  6. #                and collects them in a list.  This list is presented to the user and the
  7. #                user is asked to select one of the listed machines.
  8. #
  9. #    Dependent on:
  10. #                variable VUTargetZone     # See PickTargetZone_vu.
  11. #
  12. #
  13. #    Written by:    Chad Williams
  14. #
  15. #    Copyright:    © 1989-91 by Apple Computer, Inc., all rights reserved.
  16. #
  17. #    Change History:
  18. #
  19. #         1/9/91       chad        creation 
  20. #
  21.  
  22. SET Exit 0
  23. SET TargetAddress ''
  24. SET TargetList "`choose "{VUTargetZone}:∂≈" -list -type "Agent VU" ≥ "Dev:Null"`" 
  25. IF ("{TargetList}" == '')
  26.     ALERT "∂nThere aren't any machines running 'Agent VU'∂nin the Target Zone '{VUTargetZone}'."
  27.     EXIT 1
  28. END
  29. SET TargetAddress "`getlistitem -s -q {TargetList} ≥ "Dev:Null"`"
  30.  
  31. Set TempVar `Evaluate "{TargetAddress}" =~ /(≈)®1:([¬:]+)®2:«0,1»/`
  32. IF ({TempVar} != 0)
  33.     Set TempVar "{®1}"
  34.  
  35.     Set Tempzone `Evaluate "{TempVar}" =~ /∂'(≈)®1/`
  36.     IF ({Tempzone} != 0)
  37.         Set Tempzone "{®1}"
  38.     ELSE
  39.         Set Tempzone "{TempVar}"
  40.     END #remove front single quote if present
  41.  
  42.     IF ("{Tempzone}" == '')
  43.         Set Tempzone "*"
  44.     END #set zone to local
  45.  
  46.     SET VUTargetZone "{Tempzone}"
  47.     TARGET "{VUSettings}"
  48.     FIND 1
  49.     ECHO "{Tempzone}" > §
  50.     CLOSE -y "{VUSettings}"
  51.     
  52.     Set TempVar "{®2}"
  53.     IF ("{TempVar}" != '')
  54.         Set Tempobject `Evaluate "{TempVar}" =~ /(≈)®1∂'/`
  55.         IF ({Tempobject} != 0)
  56.             Set Tempobject "{®1}"
  57.         ELSE
  58.             Set Tempobject "{TempVar}"
  59.         END #remove end single quote if present
  60.  
  61.         SET VUTargetName "{Tempobject}"
  62.         TARGET "{VUSettings}"
  63.         FIND 2
  64.         ECHO "{Tempobject}" > §
  65.         CLOSE -y "{VUSettings}"
  66.     END
  67. END #If evaluated true